/*
 * jScroller2 1.5 - Scroller Script
 *
 * Copyright (c) 2008 Markus Bordihn (markusbordihn.de)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008-06-12 18:00:00 +0100 (Sat, 12 July 2008) $
 * $Rev: 1.5 $
 */
 
//eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('k={1Y:{2f:"25 1X",1O:1.5,24:"22 1W (1U://1N.1J)",2d:"2c 27 26"},m:[],t:{19:17,1z:1V,z:\'1S\',Z:0,1d:0},1r:D(){v a=29.1D(\'1C\'),i;M(i=0;i<a.F;i++){v b=a[i].V.S(\' \'),q=18;l(k.C(b,k.t.z+\'B\')){q=\'B\'}E l(k.C(b,k.t.z+\'T\')){q=\'T\'}E l(k.C(b,k.t.z+\'r\')){q=\'r\'}E l(k.C(b,k.t.z+\'Q\')){q=\'Q\'}l(q){k.1w(a[i],q)}}l(!k.19){l(k.m.F>0){k.Y();l(k.t.Z){M(i=0;i<k.m.F;i++){l(k.m[i][11]>0){K.1L("k.Z("+k.m[i][11]+",0)",k.m[i][11])}}}l(k.t.1d===0){k.N(K,\'1K\',k.1f);k.N(K,\'1I\',k.Y);k.N(K,\'1H\',k.Y);k.N(K,\'1G\',k.Y)}}}},1w:D(a,b){v i,1c=17;l(a&&b){l(k.m.F>0){M(i=0;i<k.m.F;i++){l(k.m[i][2]===a){k.m[i][8]=b;1c=1F}}}}E{1c=1F}l(!1c){v c=0,p=1,U=0,x=0,X=0,o=a,O=o.V.S(\' \'),y=a.1m,w=18,1l=18,1b=18,1k=D(e){k.1j(e,0)},1i=D(e){k.1j(e,1)};l(y.V.1a(\'23\')>=0){y=y.1m}l(y){y.n.1h=\'21\';y.n.20=\'1Z\';v d=y.1D(\'1C\');M(i=0;i<d.F;i++){v f=d[i].V.S(\' \');l(k.C(f,k.t.z+b+\'1B\')){w=d[i]}}l(o){o.n.1h=\'1A\';o.n.R=o.n.r=0;W(b){s"B":o.n.R=(o.L*-1)+y.L+\'u\';A;s"Q":o.n.r=(o.I*-1)+y.I+\'u\';A}W(b){s"B":s"T":o.n.1y=y.I+\'u\';A;s"Q":s"r":o.n.1x=y.L+\'u\';A}l(w){w.n.1h=\'1A\';1l=w.I;1b=w.L;W(b){s"B":w.n.R=1b*-1+\'u\';A;s"T":w.n.R=o.L+\'u\';A;s"r":w.n.r=o.I+\'u\';A;s"Q":w.n.r=o.I*-1+\'u\';A}W(b){s"B":s"T":w.n.r=0;w.n.1y=y.I+\'u\';A;s"r":s"Q":w.n.R=0;w.n.1x=y.L+\'u\';A}}}l(k.C(O,k.t.z+\'p-\',1)){p=14(k.C(O,k.t.z+\'p-\',1)||10)/10;l(K.1e&&p<1){p=1}}l(k.C(O,k.t.z+\'1T\')){k.t.1d=1}l(k.C(O,k.t.z+\'x\')){x=1}l(k.C(O,k.t.z+\'X\')){X=1}l(k.C(O,k.t.z+\'16-\',1)){U=1;k.t.Z=1;c=k.C(O,k.t.z+\'16-\',1)*1R}l(k.C(O,k.t.z+\'1v\')){k.N(o,\'1u\',1i);k.N(o,\'1t\',1k);l(w){k.N(w,\'1u\',1i);k.N(w,\'1t\',1k)}}k.m.1M([y.L,y.I,o,o.L,o.I,w,1b,1l,b,p,U,c,x,X])}}},1P:D(a){l(a){M(v i=0;i<k.m.F;i++){l(k.m[i][2]===a){k.m.1Q(i,1)}}l(k.m.F<=0){k.1f()}}},1s:D(){M(v i=0;i<k.m.F;i++){v a=k.m[i][0],H=k.m[i][1],o=k.m[i][2],G=k.m[i][3],J=k.m[i][4],P=k.m[i][5],1o=k.m[i][6],1g=k.m[i][7],q=k.m[i][8],p=k.m[i][9],U=k.m[i][10],16=k.m[i][11],x=k.m[i][12],X=k.m[i][13];l(!U&&!16){l(X){G=k.m[i][3]=o.L;J=k.m[i][4]=o.I;l(P){1o=k.m[i][6]=P.L;1g=k.m[i][7]=P.I}}W(q){s\'B\':s\'T\':v b=14(o.n.R.S(\'u\')[0]);b=(x===2)?((q===\'B\')?b-p:b+p):((q===\'B\')?b+p:b-p);l(P&&!x){b=k.1q(q,\'R\',b,P,G,a,1o,p,x)}E{l(x){l(x===((q===\'B\')?1:2)&&((G>a&&b+p>0)||(G<a&&b+G+p>a))){k.m[i][12]=((q===\'B\')?2:1)}l(x===((q===\'B\')?2:1)&&((G>a&&b+G<a+p)||(G<a&&b<0))){k.m[i][12]=((q===\'B\')?1:2)}}E{l(q===\'B\'){l(b>H){b=(G)*-1}}E{l(b<G*-1){b=a}}}}o.n.R=b+\'u\';A;s\'r\':s\'Q\':v c=14(o.n.r.S(\'u\')[0]);c=(x===2)?((q===\'r\')?c+p:c-p):(q===\'r\')?c-p:c+p;l(P&&!x){c=k.1q(q,\'r\',c,P,J,H,1g,p,x)}E{l(x){l(x===((q===\'r\')?2:1)&&((J>H&&c+p>0)||(J<H&&c+J+p>H))){k.m[i][12]=((q===\'r\')?1:2)}l(x===((q===\'r\')?1:2)&&((J>H&&c+J<H+p)||(J<H&&c-p<0))){k.m[i][12]=((q===\'r\')?2:1)}}E{l(q===\'r\'){l(c<J*-1){c=H}}E{l(c>H){c=(J)*-1}}}}o.n.r=c+\'u\';A}}}},1q:D(a,b,c,d,e,f,g,h,i){v j;W(a){s\'B\':s\'Q\':j=14(d.n[b].S(\'u\')[0])+h;l(c>0&&c<=f){d.n[b]=c-g+\'u\'}l(j+g>=f&&j<=f+h){d.n[b]=j+\'u\';c=j+e*-1}1p c;s\'T\':s\'r\':j=14(d.n[b].S(\'u\')[0])-h;l(c+e<=f){d.n[b]=c+e+\'u\'}l(j+g<=f&&j+g+h>=0){d.n[b]=j+\'u\';c=j+g}1p c}},Y:D(e){l(!k.15){k.19=k.15=K.2b(k.1s,k.t.1z)}},1f:D(e){l(k.15){K.2a(k.15);k.19=k.15=17}},1j:D(e,a){l(e.1n||e.1E){v b=e.1n?e.1n:e.1E;M(v i=0;i<5;i++){l(b.V.1a(k.t.z+\'1v\')<0&&b.V.1a(\'1B\')<0){b=b.1m}E{A}}k.U(b,a)}},Z:D(a){l(a>0){M(v i=0;i<k.m.F;i++){l(a===k.m[i][11]){k.m[i][10]=k.m[i][11]=0}}}},U:D(a,b){l(a&&b>=0){M(v i=0;i<k.m.F;i++){l(a===k.m[i][2]||a===k.m[i][5]){k.m[i][10]=b}}}},C:D(a,b,c){v d=\'\';l(a&&b){M(v i=0;i<a.F;i++){l(c&&a[i].1a(b)>=0){d=a[i].S(b)[1];A}E l(a[i]===b){d=a[i];A}}}1p d},N:D(a,b,c){l(a&&b&&c){l(K.1e){a.1e("28"+b,c)}E{a.2e(b,c,17)}}}};k.N(K,\'2g\',k.1r);',62,141,'||||||||||||||||||||ByRei_jScroller2|if|obj|style|child_div|speed|direction|left|case|cache|px|var|child_endless|alternate|parent_div|prefix|break|down|check_array|function|else|length|child_div_height|parent_div_width|clientWidth|child_div_width|window|clientHeight|for|set_eventListener|child_div_classNames|endless_div|right|top|split|up|pause|className|switch|dynamic|start|delayer|||||parseFloat|timer|delay|false|null|active|indexOf|child_endless_Height|error|ileave|attachEvent|stop|endless_div_width|position|func_stop|start_stop|func_start|child_endless_Width|parentNode|target|endless_div_height|return|check_endless|init|scroller|mouseout|mouseover|mousemove|add|height|width|refreshtime|absolute|_endless|div|getElementsByTagName|srcElement|true|scroll|resize|focus|de|blur|setTimeout|push|markusbordihn|Version|remove|splice|1000|jscroller2_|ignoreleave|http|150|Bordihn|jScroller2|info|hidden|overflow|relative|Markus|jscroller2|Author|ByRei|Autoscroller|Generation|on|document|clearInterval|setInterval|Next|Description|addEventListener|Name|load'.split('|'),0,{}))

ByRei_jScroller2 = {
    info: {
        Name: "ByRei jScroller2",
        Version: 1.5,
        Author: "Markus Bordihn (http://markusbordihn.de)",
        Description: "Next Generation Autoscroller"
    },
    obj: [],
    cache: {
        active: false,
        refreshtime: 50,
        prefix: 'jscroller2_',
        delayer: 0,
        ileave: 0
    },
    init: function () {
        var a = document.getElementsByTagName('div'),
            i;
        for (i = 0; i < a.length; i++) {
            var b = a[i].className.split(' '),
                direction = null;
            if (ByRei_jScroller2.check_array(b, ByRei_jScroller2.cache.prefix + 'down')) {
                direction = 'down'
            } else if (ByRei_jScroller2.check_array(b, ByRei_jScroller2.cache.prefix + 'up')) {
                direction = 'up'
            } else if (ByRei_jScroller2.check_array(b, ByRei_jScroller2.cache.prefix + 'left')) {
                direction = 'left'
            } else if (ByRei_jScroller2.check_array(b, ByRei_jScroller2.cache.prefix + 'right')) {
                direction = 'right'
            }
            if (direction) {
                ByRei_jScroller2.add(a[i], direction)
            }
        }
        if (!ByRei_jScroller2.active) {
            if (ByRei_jScroller2.obj.length > 0) {
                ByRei_jScroller2.start();
                if (ByRei_jScroller2.cache.delayer) {
                    for (i = 0; i < ByRei_jScroller2.obj.length; i++) {
                        if (ByRei_jScroller2.obj[i][11] > 0) {
                            window.setTimeout("ByRei_jScroller2.delayer(" + ByRei_jScroller2.obj[i][11] + ",0)", ByRei_jScroller2.obj[i][11])
                        }
                    }
                }
                if (ByRei_jScroller2.cache.ileave === 0) {
                    ByRei_jScroller2.set_eventListener(window, 'blur', ByRei_jScroller2.stop);
                    ByRei_jScroller2.set_eventListener(window, 'focus', ByRei_jScroller2.start);
                    ByRei_jScroller2.set_eventListener(window, 'resize', ByRei_jScroller2.start);
                    ByRei_jScroller2.set_eventListener(window, 'scroll', ByRei_jScroller2.start)
                }
            }
        }
    },
    add: function (a, b) {
        var i, error = false;
        if (a && b) {
            if (ByRei_jScroller2.obj.length > 0) {
                for (i = 0; i < ByRei_jScroller2.obj.length; i++) {
                    if (ByRei_jScroller2.obj[i][2] === a) {
                        ByRei_jScroller2.obj[i][8] = b;
                        error = true
                    }
                }
            }
        } else {
            error = true
        }
        if (!error) {
            var c = 0,
                speed = 1,
                pause = 0,
                alternate = 0,
                dynamic = 0,
                child_div = a,
                child_div_classNames = child_div.className.split(' '),
                parent_div = a.parentNode,
                child_endless = null,
                child_endless_Width = null,
                child_endless_Height = null,
                func_start = function (e) {
                    ByRei_jScroller2.start_stop(e, 0)
                },
                func_stop = function (e) {
                    ByRei_jScroller2.start_stop(e, 1)
                };
            if (parent_div.className.indexOf('jscroller2') >= 0) {
                parent_div = parent_div.parentNode
            }
            if (parent_div) {
                parent_div.style.position = 'relative';
                parent_div.style.overflow = 'hidden';
                var d = parent_div.getElementsByTagName('div');
                for (i = 0; i < d.length; i++) {
                    var f = d[i].className.split(' ');
                    if (ByRei_jScroller2.check_array(f, ByRei_jScroller2.cache.prefix + b + '_endless')) {
                        child_endless = d[i]
                    }
                }
                if (child_div) {
                    child_div.style.position = 'absolute';
                    child_div.style.top = child_div.style.left = 0;
                    switch (b) {
                    case "down":
                        child_div.style.top = (child_div.clientHeight * -1) + parent_div.clientHeight + 'px';
                        break;
                    case "right":
                        child_div.style.left = (child_div.clientWidth * -1) + parent_div.clientWidth + 'px';
                        break
                    }
                    switch (b) {
                    case "down":
                    case "up":
                        child_div.style.width = parent_div.clientWidth + 'px';
                        break;
                    case "right":
                    case "left":
                        child_div.style.height = parent_div.clientHeight + 'px';
                        break
                    }
                    if (child_endless) {
                        child_endless.style.position = 'absolute';
                        child_endless_Width = child_endless.clientWidth;
                        child_endless_Height = child_endless.clientHeight;
                        switch (b) {
                        case "down":
                            child_endless.style.top = child_endless_Height * -1 + 'px';
                            break;
                        case "up":
                            child_endless.style.top = child_div.clientHeight + 'px';
                            break;
                        case "left":
                            child_endless.style.left = child_div.clientWidth + 'px';
                            break;
                        case "right":
                            child_endless.style.left = child_div.clientWidth * -1 + 'px';
                            break
                        }
                        switch (b) {
                        case "down":
                        case "up":
                            child_endless.style.left = 0;
                            child_endless.style.width = parent_div.clientWidth + 'px';
                            break;
                        case "left":
                        case "right":
                            child_endless.style.top = 0;
                            child_endless.style.height = parent_div.clientHeight + 'px';
                            break
                        }
                    }
                }
                if (ByRei_jScroller2.check_array(child_div_classNames, ByRei_jScroller2.cache.prefix + 'speed-', 1)) {
                    speed = parseFloat(ByRei_jScroller2.check_array(child_div_classNames, ByRei_jScroller2.cache.prefix + 'speed-', 1) || 10) / 10;
                    if (window.attachEvent && speed < 1) {
                        speed = 1
                    }
                }
                if (ByRei_jScroller2.check_array(child_div_classNames, ByRei_jScroller2.cache.prefix + 'ignoreleave')) {
                    ByRei_jScroller2.cache.ileave = 1
                }
                if (ByRei_jScroller2.check_array(child_div_classNames, ByRei_jScroller2.cache.prefix + 'alternate')) {
                    alternate = 1
                }
                if (ByRei_jScroller2.check_array(child_div_classNames, ByRei_jScroller2.cache.prefix + 'dynamic')) {
                    dynamic = 1
                }
                if (ByRei_jScroller2.check_array(child_div_classNames, ByRei_jScroller2.cache.prefix + 'delay-', 1)) {
                    pause = 1;
                    ByRei_jScroller2.cache.delayer = 1;
                    c = ByRei_jScroller2.check_array(child_div_classNames, ByRei_jScroller2.cache.prefix + 'delay-', 1) * 1000
                }
                if (ByRei_jScroller2.check_array(child_div_classNames, ByRei_jScroller2.cache.prefix + 'mousemove')) {
                    ByRei_jScroller2.set_eventListener(child_div, 'mouseover', func_stop);
                    ByRei_jScroller2.set_eventListener(child_div, 'mouseout', func_start);
                    if (child_endless) {
                        ByRei_jScroller2.set_eventListener(child_endless, 'mouseover', func_stop);
                        ByRei_jScroller2.set_eventListener(child_endless, 'mouseout', func_start)
                    }
                }
                ByRei_jScroller2.obj.push([parent_div.clientHeight, parent_div.clientWidth, child_div, child_div.clientHeight, child_div.clientWidth, child_endless, child_endless_Height, child_endless_Width, b, speed, pause, c, alternate, dynamic])
            }
        }
    },
    remove: function (a) {
        if (a) {
            for (var i = 0; i < ByRei_jScroller2.obj.length; i++) {
                if (ByRei_jScroller2.obj[i][2] === a) {
                    ByRei_jScroller2.obj.splice(i, 1)
                }
            }
            if (ByRei_jScroller2.obj.length <= 0) {
                ByRei_jScroller2.stop()
            }
        }
    },
    scroller: function () {
        for (var i = 0; i < ByRei_jScroller2.obj.length; i++) {
            var a = ByRei_jScroller2.obj[i][0],
                parent_div_width = ByRei_jScroller2.obj[i][1],
                child_div = ByRei_jScroller2.obj[i][2],
                child_div_height = ByRei_jScroller2.obj[i][3],
                child_div_width = ByRei_jScroller2.obj[i][4],
                endless_div = ByRei_jScroller2.obj[i][5],
                endless_div_height = ByRei_jScroller2.obj[i][6],
                endless_div_width = ByRei_jScroller2.obj[i][7],
                direction = ByRei_jScroller2.obj[i][8],
                speed = ByRei_jScroller2.obj[i][9],
                pause = ByRei_jScroller2.obj[i][10],
                delay = ByRei_jScroller2.obj[i][11],
                alternate = ByRei_jScroller2.obj[i][12],
                dynamic = ByRei_jScroller2.obj[i][13];
            if (!pause && !delay) {
                if (dynamic) {
                    child_div_height = ByRei_jScroller2.obj[i][3] = child_div.clientHeight;
                    child_div_width = ByRei_jScroller2.obj[i][4] = child_div.clientWidth;
                    if (endless_div) {
                        endless_div_height = ByRei_jScroller2.obj[i][6] = endless_div.clientHeight;
                        endless_div_width = ByRei_jScroller2.obj[i][7] = endless_div.clientWidth
                    }
                }
                switch (direction) {
                case 'down':
                case 'up':
                    var b = parseFloat(child_div.style.top.split('px')[0]);
                    b = (alternate === 2) ? ((direction === 'down') ? b - speed : b + speed) : ((direction === 'down') ? b + speed : b - speed);
                    if (endless_div && !alternate) {
                        b = ByRei_jScroller2.check_endless(direction, 'top', b, endless_div, child_div_height, a, endless_div_height, speed, alternate)
                    } else {
                        if (alternate) {
                            if (alternate === ((direction === 'down') ? 1 : 2) && ((child_div_height > a && b + speed > 0) || (child_div_height < a && b + child_div_height + speed > a))) {
                                ByRei_jScroller2.obj[i][12] = ((direction === 'down') ? 2 : 1)
                            }
                            if (alternate === ((direction === 'down') ? 2 : 1) && ((child_div_height > a && b + child_div_height < a + speed) || (child_div_height < a && b < 0))) {
                                ByRei_jScroller2.obj[i][12] = ((direction === 'down') ? 1 : 2)
                            }
                        } else {
                            if (direction === 'down') {
                                if (b > parent_div_width) {
                                    b = (child_div_height) * -1
                                }
                            } else {
                                if (b < child_div_height * -1) {
                                    b = a
                                }
                            }
                        }
                    }
                    child_div.style.top = b + 'px';
                    break;
                case 'left':
                case 'right':
                    var c = parseFloat(child_div.style.left.split('px')[0]);
                    c = (alternate === 2) ? ((direction === 'left') ? c + speed : c - speed) : (direction === 'left') ? c - speed : c + speed;
                    if (endless_div && !alternate) {
                        c = ByRei_jScroller2.check_endless(direction, 'left', c, endless_div, child_div_width, parent_div_width, endless_div_width, speed, alternate)
                    } else {
                        if (alternate) {
                            if (alternate === ((direction === 'left') ? 2 : 1) && ((child_div_width > parent_div_width && c + speed > 0) || (child_div_width < parent_div_width && c + child_div_width + speed > parent_div_width))) {
                                ByRei_jScroller2.obj[i][12] = ((direction === 'left') ? 1 : 2)
                            }
                            if (alternate === ((direction === 'left') ? 1 : 2) && ((child_div_width > parent_div_width && c + child_div_width < parent_div_width + speed) || (child_div_width < parent_div_width && c - speed < 0))) {
                                ByRei_jScroller2.obj[i][12] = ((direction === 'left') ? 2 : 1)
                            }
                        } else {
                            if (direction === 'left') {
                                if (c < child_div_width * -1) {
                                    c = parent_div_width
                                }
                            } else {
                                if (c > parent_div_width) {
                                    c = (child_div_width) * -1
                                }
                            }
                        }
                    }
                    child_div.style.left = c + 'px';
                    break
                }
            }
        }
    },
    check_endless: function (a, b, c, d, e, f, g, h, i) {
        var j;
        switch (a) {
        case 'down':
        case 'right':
            j = parseFloat(d.style[b].split('px')[0]) + h;
            if (c > 0 && c <= f) {
                d.style[b] = c - g + 'px'
            }
            if (j + g >= f && j <= f + h) {
                d.style[b] = j + 'px';
                c = j + e * -1
            }
            return c;
        case 'up':
        case 'left':
            j = parseFloat(d.style[b].split('px')[0]) - h;
            if (c + e <= f) {
                d.style[b] = c + e + 'px'
            }
            if (j + g <= f && j + g + h >= 0) {
                d.style[b] = j + 'px';
                c = j + g
            }
            return c
        }
    },
    start: function (e) {
        if (!ByRei_jScroller2.timer) {
            ByRei_jScroller2.active = ByRei_jScroller2.timer = window.setInterval(ByRei_jScroller2.scroller, ByRei_jScroller2.cache.refreshtime)
        }
    },
    stop: function (e) {
        if (ByRei_jScroller2.timer) {
            window.clearInterval(ByRei_jScroller2.timer);
            ByRei_jScroller2.active = ByRei_jScroller2.timer = false
        }
    },
    start_stop: function (e, a) {
        if (e.target || e.srcElement) {
            var b = e.target ? e.target : e.srcElement;
            for (var i = 0; i < 5; i++) {
                if (b.className.indexOf(ByRei_jScroller2.cache.prefix + 'mousemove') < 0 && b.className.indexOf('_endless') < 0) {
                    b = b.parentNode
                } else {
                    break
                }
            }
            ByRei_jScroller2.pause(b, a)
        }
    },
    delayer: function (a) {
        if (a > 0) {
            for (var i = 0; i < ByRei_jScroller2.obj.length; i++) {
                if (a === ByRei_jScroller2.obj[i][11]) {
                    ByRei_jScroller2.obj[i][10] = ByRei_jScroller2.obj[i][11] = 0
                }
            }
        }
    },
    pause: function (a, b) {
        if (a && b >= 0) {
            for (var i = 0; i < ByRei_jScroller2.obj.length; i++) {
                if (a === ByRei_jScroller2.obj[i][2] || a === ByRei_jScroller2.obj[i][5]) {
                    ByRei_jScroller2.obj[i][10] = b
                }
            }
        }
    },
    check_array: function (a, b, c) {
        var d = '';
        if (a && b) {
            for (var i = 0; i < a.length; i++) {
                if (c && a[i].indexOf(b) >= 0) {
                    d = a[i].split(b)[1];
                    break
                } else if (a[i] === b) {
                    d = a[i];
                    break
                }
            }
        }
        return d
    },
    set_eventListener: function (a, b, c) {
        if (a && b && c) {
            if (window.attachEvent) {
                a.attachEvent("on" + b, c)
            } else {
                a.addEventListener(b, c, false)
            }
        }
    }
};
ByRei_jScroller2.set_eventListener(window, 'load', ByRei_jScroller2.init);